package com.hbpu.encap.homework02;

import java.util.Scanner;

public class Homework08 {
    public static void main(String[] args) {
        do {
            try {
                System.out.print("请输入一个整数：");
                String input = new Scanner(System.in).next();
                int transform = Integer.parseInt(input);
                System.out.println("转换成功：" + transform);
                return;
            } catch (NumberFormatException e) {
                System.out.println("输入错误！");
            }
        } while (true);
    }
}
